--
-- Author: shunguo.chen
-- Date: 2018-03-21 10:22:08
--
-- ChessNpcView	谜棋npc界面
--

local fileName = string.getModeName(...)
local ClassRef = class(fileName, app.mvc.ViewBase)

ClassRef.VIEW_ROOT_RES = Res.ChessNpcScene

function ClassRef:init()
	self:setBackGroundColorOpacity(0)
	display.setCascadeOpacityEnabled(self._root, true)

    self._ui.Panel:setTouchEnabled(false)
    self:addClickEventListener(function()
        if not self._isTimeOver then
            self._ui.Panel:stopAllActions()
            self:setVisible(false)
            executeFunc(self._cb)
        end
    end)
end

function ClassRef:refresh(msg, time, cb)
    self._isTimeOver = false
    self._cb = cb
	self._ui.text:setString(msg)
	self._ui.Panel:performWithDelay(function()
            self._isTimeOver = true
			self:hide(cb)
		end, time)

end

return ClassRef
